using UnityEngine;

namespace Share
{
    public class HpBar : MonoBehaviour
    {
        SpriteRenderer m_Render = null;
        SpriteRenderer Render
        {
            get
            {
                if (m_Render == null)
                    m_Render ??= GetComponent<SpriteRenderer>();
                return m_Render;
            }
        }
        internal void SetScale(float v)
        {
            Render.material.SetFloat("_Scale", 100 * v);
        }
        public void SetOrder(int order)
        {
            Render.sortingOrder = order + 1;
        }

    }
}